//配置页面加载模块参数
require.config({
	//版本号
//	urlArgs:"v="+(new Date()).getTime(),
	//加载等待时间
	//waitSeconds:120,
	//添加加载异步加载CSS的插件
	map:{
		'*':{
			'css':'../lib/css.min'
		}
	},
	//配置Javascript文件映射路径
	paths: {
		modernizr		:"../lib/modernizr.custom",
		jquery			:"../lib/jquery-2.0.3.min",
		nicescroller	:"../lib/jquery.nicescroll",
		template7		:"../lib/template7.min",
		jq_validate		:"../lib/jquery.validate.min",
		sweetalert		:"../lib/sweetalert/sweetalert-dev",
		chosen			:"../lib/chosen/chosen.jquery",
		html2canvas		:'../lib/html2canvas.min',
		datetimepicker	:"../lib/bootstrap-datetimepicker/bootstrap-datetimepicker.min",
		application		:"application",
		echarts			:"../echarts/echarts.min",
		echartsConfig	:"../echarts/echartsConfig",
		AS				:"../ajax/ajaxServer",
		jay				:"jay",
		simpleTree		:"../lib/SimpleTree/SimpleTree"
	},
	shim: {
		sweetalert		:{deps: ['css!../lib/sweetalert/sweetalert.css']},
		chosen			:{deps: ['css!../lib/chosen/chosen.css']},
		simpleTree			:{deps: ['css!../lib/SimpleTree/tree_themes/SimpleTree.css']},
		datetimepicker	:{deps: ['css!../lib/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css']},
		application		:{deps: ['jquery','template7','sweetalert']},
		echartsConfig	:{deps: ['echarts']}
	}
});

//配置页面加载模块
require(['AS','pagination','application','modernizr'],function(AS,pagination) {
	if(!Modernizr.rgba){
		window.location="np.html";
	}else{
		webComm.AS = AS;
		webComm.MyPagination = pagination;
		$(function(){
			initDateTimepicker();
			webComm.init();
		});
	}
});

function initDateTimepicker() {
    require(["datetimepicker"], function() {
        $.fn.datetimepicker.dates['zh-CN'] = {
            days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
            daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
            daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
            months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            today: "今天",
            suffix: [],
            meridiem: ["上午", "下午"]
        };
        $('.pickerinit').datetimepicker({
            language: 'zh-CN',
            todayBtn: true,
            //若只选择到小时 --打开下面三个条件
            // format: 'yyyy-mm-dd hh',
            // startView:'day',  
            // minView:'day',

            //若只选择到日期 --打开下面三个条件
            format: 'yyyy-mm-dd',
            startView:'month',  
            minView:'month',
             
            //若只选择到月份 --打开下面三个条件
            // format: 'yyyy-mm',
            // startView:'year',  
            // minView:'year',
             
            //若只选择到年份 --打开下面三个条件
            // format: 'yyyy',
            // startView:'decade',  
            // minView:'decade',
            
            // 高亮当前日期
            //todayHighlight:true,
            autoclose:true
        });
        
        $('.timepickerinit').datetimepicker({
            language: 'zh-CN',
            todayBtn: true,
            //若只选择到小时 --打开下面三个条件
            // format: 'yyyy-mm-dd hh',
            // startView:'day',  
            // minView:'day',

            //若只选择到日期 --打开下面三个条件
            format: 'yyyy-mm-dd hh:ii:ss',
            startView:'day',  
            minView:'day',
             
            //若只选择到月份 --打开下面三个条件
            // format: 'yyyy-mm',
            // startView:'year',  
            // minView:'year',
             
            //若只选择到年份 --打开下面三个条件
            // format: 'yyyy',
            // startView:'decade',  
            // minView:'decade',
            
            // 高亮当前日期
            //todayHighlight:true,
            autoclose:true
        });
    });
}
